package com.hzvictory.hotel_system.service.Impl;
import java.util.List;
import com.hzvictory.hotel_system.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hzvictory.hotel_system.mapper.SeatorderMapper;
import com.hzvictory.hotel_system.pojo.entity.Seatorder;
import com.hzvictory.hotel_system.service.ISeatorderService;
/**
 * 功能
 * 作者：何征
 * 日期：2025/7/23 23:07
 */
@Service
public class SeatorderServiceImpl implements ISeatorderService
{
    @Autowired
    private SeatorderMapper seatorderMapper;

    /**
     * 查询座位订单
     *
     * @param id 座位订单主键
     * @return 座位订单
     */
    @Override
    public Seatorder selectSeatorderById(Long id)
    {
        return seatorderMapper.selectSeatorderById(id);
    }

    /**
     * 查询座位订单列表
     *
     * @param seatorder 座位订单
     * @return 座位订单
     */
    @Override
    public List<Seatorder> selectSeatorderList(Seatorder seatorder)
    {
        return seatorderMapper.selectSeatorderList(seatorder);
    }
    /**
     * 根据用户id查询座位订单列表
     *
     * @param userId 用户id
     * @return 座位订单
     */
    @Override
    public List<Seatorder> selectSeatorderListByUserId(Long userId)
    {
        return seatorderMapper.selectSeatorderListByUserId(userId);
    }

    /**
     * 新增座位订单
     *
     * @param seatorder 座位订单
     * @return 结果
     */
    @Override
    public int insertSeatorder(Seatorder seatorder)
    {
        seatorder.setCreateTime(DateUtils.getNowDate());
        return seatorderMapper.insertSeatorder(seatorder);
    }

    /**
     * 修改座位订单
     *
     * @param seatorder 座位订单
     * @return 结果
     */
    @Override
    public int updateSeatorder(Seatorder seatorder)
    {
        return seatorderMapper.updateSeatorder(seatorder);
    }

    @Override
    public int updateSeatorderStatusById(Long id)
    {
        return seatorderMapper.updateSeatorderStatusById(id);
    }
    /**
     * 批量删除座位订单
     *
     * @param ids 需要删除的座位订单主键
     * @return 结果
     */
    @Override
    public int deleteSeatorderByIds(Long[] ids)
    {
        return seatorderMapper.deleteSeatorderByIds(ids);
    }

    /**
     * 删除座位订单信息
     *
     * @param id 座位订单主键
     * @return 结果
     */
    @Override
    public int deleteSeatorderById(Long id)
    {
        return seatorderMapper.deleteSeatorderById(id);
    }
}